//
//  CacheHelper.h
//  TooToo
//  本地缓存
//  Created by MoHao on 14-3-4.
//  Copyright (c) 2014年 MoHao. All rights reserved.
//

#import <Foundation/Foundation.h>

#define rootFolder @"FbeeImageChache"
#define DOCUMENTS_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]

//钱包
#define WalletDataCachePath           [DOCUMENTS_FOLDER stringByAppendingPathComponent:@"/WalletList"]

//配置文件 - 功能显示隐藏
#define ConfigPath    [DOCUMENTS_FOLDER stringByAppendingPathComponent:@"/Config"]

@class ArchivesMessageObj;

@interface CacheHelper : NSObject

#pragma mark - 检查

//检查文件与文件夹是否存在
+(Boolean)checkfile:(NSString *)_path;
//判断图片缓存的有效期，如果过期，就删除
+(void)judgeImageCacheValidDate;
//判断广告缓存的有效期，如果过期，就删除
+(void)judgeAdvertCacheValidDate;


#pragma mark - 创建

//创建文件夹
+(Boolean)createfolder:(NSString *)folderName;
+(BOOL)createFolder:(NSString*)folder;

#pragma mark - 保存

//缓存Data
+(Boolean)saveCacheData:(NSData*)_data path:(NSString*)_path;
//缓存字典
+(Boolean)saveCacheDictionary:(NSDictionary *)_dict path:(NSString *)_path;
//缓存数组
+(Boolean)saveCacheArray:(NSArray *)array path:(NSString *)_path;


#pragma mark - 获取

//根据路径获取相应的data
+(NSData *)getDataByFilePath:(NSString *)filePath;
//根据路径获取相应的Dictionary
+(NSDictionary *)getDictionaryByFilePath:(NSString *)filePath;
//根据路径获取相应的array
+(NSArray *)getArrayByFilePath:(NSString *)filePath;
//获取本地字典数据
+(NSDictionary*)getDictionaryByFileName:(NSString*)_filename;


#pragma mark - 删除

//清除本地图片缓存
+(void)deleteOverDueAppFolder:(void(^)(void))complete;
//删除某个文件夹
+(BOOL)deleteFolderByFolderPath:(NSString*)folder;
//删除档案
+(BOOL)deleteArchive;
+ (long long)fileSizeAtPath:(NSString*) filePath;
//计算整个目录大小
+ (float)folderSizeAtPath:(NSString *)folderPath;
@end
